

cmake_minimum_required(VERSION 3.4.1)
#distribution_DIR:D:/MyApplication4/app/libs
set(distribution_DIR ${CMAKE_SOURCE_DIR}/libs)
message("distribution_DIR:" ${distribution_DIR})
#libavcodec添加so库依赖
add_library( libavcodec-57
        SHARED
        IMPORTED )

add_library( libavdevice-57
        SHARED
        IMPORTED )

add_library( libavfilter-6
        SHARED
        IMPORTED )

add_library( libavformat-57
        SHARED
        IMPORTED )

add_library( libavutil-55
        SHARED
        IMPORTED )



add_library( libswresample-2
        SHARED
        IMPORTED )

add_library( libswscale-4
        SHARED
        IMPORTED )

set_target_properties( libavcodec-57
        PROPERTIES IMPORTED_LOCATION
        ${distribution_DIR}/${ANDROID_ABI}/libavcodec-57.so)

set_target_properties( libavdevice-57
        PROPERTIES IMPORTED_LOCATION
        ${distribution_DIR}/${ANDROID_ABI}/libavdevice-57.so)

set_target_properties( libavfilter-6
        PROPERTIES IMPORTED_LOCATION
        ${distribution_DIR}/${ANDROID_ABI}/libavfilter-6.so)

set_target_properties( libavformat-57
        PROPERTIES IMPORTED_LOCATION
        ${distribution_DIR}/${ANDROID_ABI}/libavformat-57.so)

set_target_properties( libavutil-55
        PROPERTIES IMPORTED_LOCATION
        ${distribution_DIR}/${ANDROID_ABI}/libavutil-55.so)



set_target_properties( libswresample-2
        PROPERTIES IMPORTED_LOCATION
        ${distribution_DIR}/${ANDROID_ABI}/libswresample-2.so)

set_target_properties( libswscale-4
        PROPERTIES IMPORTED_LOCATION
        ${distribution_DIR}/${ANDROID_ABI}/libswscale-4.so)
add_library(
        native-lib
        SHARED
        src/main/cpp/native-lib.cpp)
find_library(
        log-lib
        log)

target_link_libraries( # Specifies the target library.
        native-lib
        libavcodec-57
        libavdevice-57
        libavfilter-6
        libavformat-57
        libavutil-55
        libswresample-2
        libswscale-4
        android
        ${log-lib} )

#添加头文件
include_directories(src/main/cpp/include)